#include<stdio.h>
int letter=0,digit=0,space=0,others=0;
int main()
{
    void zfchuli(char [ ]);
    int i;
    char a[100];
    printf("请输入一个字符串\n");
    gets(a);
    printf("输入的字符串是%s");
    puts(a);
    zfchuli(a);
    printf("letter is %5d\nspace is %5d\ndigit is %5d\nothers is %5d",letter,space,digit,others);
    return 0;
}
void zfchuli(char a[ ])
{
    int i;
    for(i=0;a[i]!='\0';i++)
    {
        if(a[i]>='0'&&a[i]<='9')
            digit++;
        else if((a[i]>='a'&&a[i]<='z')||a[i]>='A'&&a[i]<='Z')
            letter++;
        else if(a[i]==32)
            space++;
        else 
            others++;
    }

}